<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>京城男人帮---提交订单-没有物品时</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/head.css"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/footer.css"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/go.css"/>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/home/css/index.css"/>
	<style type="text/css" media="screen">
			*{
				margin: 0;
				padding: 0;
			}
			html,body{
				width: 100%;
				height: 100%;
				background-size: 100% 100%;
			}
			table{
				width: 100%;
				border-collapse: collapse;
			}
			table tr th{
				text-align: center;
			}
			table tr th:nth-child(3){
				text-align: left;
			}
			table tr{
				height: 80px;
				border-bottom: 1px solid #d4d4d7;
			}
			table tr td:last-child button{
				width: 50%;
				height: 80%;
				background:#C9302C;
				border-radius: 5px;
				border: 0px;
				color: #fff;
				outline: none;
			}
			table tr td{
				text-align: center;
				color: #151515;
				font-family: "微软雅黑";
				/*border: 1px solid #d4d4d7;*/
				padding-left: 5px;
				font-size: 13px;
				height: 30px;
			}
			table tr td:nth-child(2) img{
				height: 150%;
			}
			table tr td:nth-child(3){
				text-align: left;
			}
			table tr:nth-child(even){
				background: #f4f4f4;
			}
			table tr td:nth-child(4) button{
				width: 25px;
				background: #C9302C;
				border: 1px solid #C9302C;
				color: #fff;
				height: 70%;
			}
			table tr td:nth-child(4) input{
				width: 60px;
				height: 69%;
				border: 1px solid #D4D4D7;
				margin: 0px 5px;
				text-align: center;
			}
			.fcred{
				background: #EBEBE4 !important;
			}
	</style>
</head>
<body>
	<div class="header">
		<!--顶部导航-->
        {include file="public/top_nav"}
        <!--顶部导航end-->
		<!--图片-->
		<div class="full_sc order_bottom">
			<div class="w1200 header_conter ">
				<div class="h_c_logo">
    			    <a href="{:url('home/index/index')}">
    				    <img src="__PUBLIC__/home/image/logo.png"  width="102px" height="98px" />
    			    </a>
    		    </div>
    		    <div class="h_c_right">
    		    	<div class="order_Status"></div>
    		    </div>
			</div>
		</div>
		<!--end-->
	</div>

	<!--tip-->
	<div class="public_b">
		
			<?php if (!empty($cartData)){ ?>
				<table>
					<tr>
						<th>产品编号</th>
						<th>产品展示</th>
						<th>产品名称</th>
						<th>购买数量</th>
						<th>产品单价</th>
						<th>产品总价</th>
						<th>操作</th>
					</tr>
					<?php foreach ($cartData as $key => $value){ ?>
					<tr ng-repeat="item in td |filter:abc" ng-class="{'fcred':item.math==0}">
						<td><?php echo $key+1 ?></td>
						<td><img src="__PUBLIC__/<?php echo $value['g_img'] ?>"></td>
						<td><?php echo $value['g_name']; ?></td>
						<td>
							<button ng-click="jian(item,$index)">-</button>
							<input type="text" ng-model="item.math" disabled="disabled" value="<?php echo $value['s_num'] ?>">
							<button ng-click="jia(item)">+</button>
						</td>
						<td><?php echo $value['s_price'] ?> 元</td>
						<td></td>
						<td><button ng-click="del($index)"> 移 除 </button></td>
					</tr>
					<?php } ?>
					<tr>
						<td>总购买数量</td>
						<td></td>
						<td></td>
						<td>购物车总价</td>
						<td>{{totalprice()}} 元</td>
						<td colspan="2"><button ng-click="removeAll()">清空购物车</button></td>
					</tr>
				</table>
		<div class="w1200">
			<?php }else{ ?>
		<div class="w1200">
			<div class="car_no_goods">
				<img src="__PUBLIC__/home/image/car_no_goods.jpg"/>
				<div class="no_goods">
					<p class="no_goods_t">亲，您的购物车空空如也，快去抢购心仪商品吧~
					</p>
					<p><a href="{:url('home/index/index')}" class="no_goods_buy">立即购买</a></p>
				</div>
			</div>
			<?php } ?>
			
			<!--为你推荐-->
			<div class="guesslike_div">
				<div class="remat">
					<div class="d_h2">
						<ul>
                            <li class="on">猜你喜欢</li>
                        </ul>
					</div>
					<div class="detail_l_con4">
						<div class="noguess">
						<ul class="day_goods">
				            <?php if (!empty($goodsDataFx)){ ?>
				            <?php foreach ($goodsDataFx as $key => $value){ ?>
				        		<li>
				        			<a href="{:url('home/shop/iemt')}?c_id=<?php echo $value['c_id'] ?>&g_id=<?php echo $value['g_id'] ?>" class="a_con_list">
				        				<p class="p_img"><img src="__PUBLIC__/<?php echo $value['g_img'] ?>"/></p>
				        			</a>
				        			<p class="p_title">
				        				<!-- <span>【7.5折】</span> -->
				        				<?php echo $value['g_name'] ?>
				        			</p>
				        			<p class="p_p">
				        				<span class="price1">￥<span><?php echo $value['g_price'] ?></span></span>
				        				<!-- <span class="price2"><del>￥398.00</del></span> -->
				        				<!-- <a href="{:url('home/shop/iemt')}" class="gwc"></a> -->
				        			</p>
				        		</li>
				            <?php } ?>
				            <?php }else{ ?>
            					暂无商品向您推荐
            				<?php } ?>
				        </ul>
						</div>
					</div>
				</div>
			</div>
			<!--为你推荐-->
		</div>
	</div>
	<!--tipend-->
	
    <!--底部公用-->
    {include file="public/footer"}
    <!--底部end-->
</body>
</html>
<script type="text/javascript" src="__PUBLIC__/home/js/angular.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/angular-ui-router.min.js" ></script>
<script>
	$(function(){
		$(".box-tab .g_t_l_hd #next").bind("click",function(){
			if(tempLength < countLength){
				if((countLength - tempLength) > moveLength){
					scrollDiv.animate({left:"-=" + moveLength + "px"}, moveTime);
					tempLength += moveLength;
				}else{
					scrollDiv.animate({left:"-=" + (countLength - tempLength) + "px"}, moveTime);
					tempLength += (countLength - tempLength);
				}
			}
		});
		//上一张
		$(".box-tab .g_t_l_hd #prev").bind("click",function(){
			if(tempLength > 0){
				if(tempLength > moveLength){
					scrollDiv.animate({left: "+=" + moveLength + "px"}, moveTime);
					tempLength -= moveLength;
				}else{
					scrollDiv.animate({left: "+=" + tempLength + "px"}, moveTime);
					tempLength = 0;
				}
			}
		});
	})
	var myApp = angular.module("app", ["ui.router"]);
	myApp.controller('cont',function($scope,$http,$state){
		$scope.td=[
			{name:"iphone5",math:1,price:100,}
		]
		$scope.jia=function(item){
			item.math++
		}
		$scope.jian=function(item,index){
			if(item.math>0){
				item.math--
			}else{
				item.math==1
			}
	//					if(item.math==0){
	//		                $scope.td.splice(index, 1); //数量为0是 移除商品
	//					}
		}
		$scope.del=function (index) {
	        if (confirm("确认删除吗？") == true) {
	            $scope.td.splice(index, 1);
	        }
	    }//点击每条删除
		
		$scope.totalprice = function() {
	            var to_price = 0
	            for(var i = 0; i < $scope.td.length; i++) {
	                to_price += $scope.td[i].math * $scope.td[i].price
	            }
	            return to_price;
	     }//总价格
		
		$scope.zzprice=function(){
			var to_price = 0
	            for(var i = 0; i < $scope.td.length; i++) {
	                to_price += $scope.td[i].math
	            }
	            return to_price;
		}//总数
		
		$scope.removeAll = function() {
	        if (confirm("确认清空购物车吗？") == true) {
	            $scope.td=[];
	        }
	    }//清空购物车
		
	})
</script>
